<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改条形码')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-tag-edit" th:object="${yfTag}">

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">codeid：</label>
            <div class="col-sm-8">
                <input name="codeid" id="codeid" th:field="*{codeid}" class="form-control" type="text" required>
            </div>
            <span id="codePrompt" class="form-control" style="border: 0px;">
                <i></i>
            </span>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">暂存点：</label>
            <div class="col-sm-8">
                <select name="stagingId" id="stagingId" class="form-control m-b"
                        th:with="type=${@dep.depts(null,'400,310,360,370')}" th:field="*{stagingId}"
                        required>
                    <option value="">请选择</option>
                    <option th:each="dep : ${type}" th:text="${dep.deptName}" th:value="${dep.deptId}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label is-required">采集用户：</label>
            <div class="col-sm-8">
                <select name="collectUserId" id="collectUserId" class="form-control m-b"
                        th:with="users=${@yf.getUserList(null,null)}" th:field="*{collectUserId}"
                        required>
                    <option  value="">请选择</option>
                    <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">封箱状态 yf_weight_type：</label>
            <div class="col-sm-8">
                <select name="isBoxedPrint" class="form-control m-b"
                        th:with="type=${@dict.getType('yf_is_boxed_print')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{isBoxedPrint}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">来源垃圾桶id yf_bucket表：</label>
                <!--<select name="sourceBucketId" id="sourceBucketId" class="form-control m-b"-->
                        <!--th:with="bucketList=${@yf.getbucketList(null)}" th:field="*{sourceBucketId}"-->
                        <!--required>-->
                    <!--<option  value="">请选择</option>-->
                    <!--<option th:each="bucket : ${bucketList}" th:text="${bucket.bucketId}" th:value="${bucket.bucketId}"></option>-->
                <!--</select>-->
            <input name="sourceBucketId" th:field="*{sourceBucketId}" class="form-control" type="text">
            </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">采集扫码时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="collectScanDate" th:value="${#dates.format(yfTag.collectScanDate, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">来源科室 yf_dept表：</label>
            <div class="col-sm-8">
                <input name="sourceDeptId" th:field="*{sourceDeptId}" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">扫描来源科室时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="scanDeptDate" th:value="${#dates.format(yfTag.scanDeptDate, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">医废类别 yf_trash_type：</label>
            <div class="col-sm-8">
                <select name="trashType" class="form-control m-b" th:with="type=${@dict.getType('yf_trash_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{trashType}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">重量输入方式 yf_weight_type：</label>
            <div class="col-sm-8">
                <select name="weightInputType" class="form-control m-b"
                        th:with="type=${@dict.getType('yf_weight_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{weightInputType}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">重量：</label>
            <div class="col-sm-8">
                <input name="weight" th:field="*{weight}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">照片 url地址：</label>
            <div class="col-sm-8">
                <input name="img" th:field="*{img}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">采集上传时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="collectUpdateDate" th:value="${#dates.format(yfTag.collectUpdateDate, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库用户 sys_user表：</label>
            <div class="col-sm-8">
                <input name="intoUserId" th:field="*{intoUserId}" class="form-control" type="text">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">入库垃圾桶id yf_bucket表：</label>
            <div class="col-sm-8">
                <input name="intoBucketId" th:field="*{intoBucketId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="intoDate" th:value="${#dates.format(yfTag.intoDate, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库用户 sys_user：</label>
            <div class="col-sm-8">
                <input name="outUserId" th:field="*{outUserId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库垃圾桶id yf_bucket表：</label>
            <div class="col-sm-8">
                <input name="outBucketId" th:field="*{outBucketId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input name="outDate" th:value="${#dates.format(yfTag.outDate, 'yyyy-MM-dd')}" class="form-control"
                           placeholder="yyyy-MM-dd" type="text">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">医院 sys_dept表：</label>
            <div class="col-sm-8">
                <input name="hospitalId" th:field="*{hospitalId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建者 sys_user表：</label>
            <div class="col-sm-8">
                <input name="createId" th:field="*{createId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">更新者 sys_user表：</label>
            <div class="col-sm-8">
                <input name="updateId" th:field="*{updateId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">医废垃圾出入库状态 yf_trash_status：</label>
            <div class="col-sm-8">
                <select name="trashStatus" class="form-control m-b" th:with="type=${@dict.getType('yf_trash_status')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{trashStatus}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库运输车辆id：</label>
            <div class="col-sm-8">
                <input name="outCarId" th:field="*{outCarId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态0:正常 1:异常 yf_exception_level：</label>
            <div class="col-sm-8">
                <select name="status" class="form-control m-b" th:with="type=${@dict.getType('yf_exception_level')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{status}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">采集设备 id：</label>
            <div class="col-sm-8">
                <input name="collectId" th:field="*{collectId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库设备 id：</label>
            <div class="col-sm-8">
                <input name="intoId" th:field="*{intoId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库设备 id：</label>
            <div class="col-sm-8">
                <input name="outId" th:field="*{outId}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">采集设备信息：</label>
            <div class="col-sm-8">
                <input name="collectDetails" th:field="*{collectDetails}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入库设备信息：</label>
            <div class="col-sm-8">
                <input name="intoDetails" th:field="*{intoDetails}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">出库设备信息：</label>
            <div class="col-sm-8">
                <input name="outDetails" th:field="*{outDetails}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">更新方式 yf_update_way：</label>
            <div class="col-sm-8">
                <select name="updateWay" class="form-control m-b" th:with="type=${@dict.getType('yf_update_way')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                            th:field="*{updateWay}"></option>
                </select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "yf/tag";
    $("#form-tag-edit").validate({
        focusCleanup: true
    });

/*   var yfTag =  [[${yfTag}]];
    nizaigaosm




*/
    //获取用户
    function getUser(stagingId, roleId) {
        $.post(ctx + "system/user/adds/list", {
            stagingId: stagingId
        }, function (res) {
            if (res.code == 0) {
                console.log(res)
                var html = "<option value='0'>请选择</option>";
                $.each(res.rows, function (i, v) {
                    html += ' <option  value="' + v.userId + '" >' + v.userName + '</option>';
                })
                if (html != "") {
                    //采集员
                    $("#collectUserId").html(html)
                    $("#collectUserId").attr("disabled", false);
                    //入库员
                    $("#intoUserId").html(html)
                    $("#intoUserId").attr("disabled", false);
                    //出库员
                    $("#outUserId").html(html)
                    $("#outUserId").attr("disabled", false);
                } else {
                    //采集员
                    $("#collectUserId").html('<option value="" >请选择</option>')
                    $("#collectUserId").attr("disabled", true);
                    //入库员
                    $("#intoUserId").html('<option value="" >请选择</option>')
                    $("#intoUserId").attr("disabled", true);
                    //出库员
                    $("#outUserId").html('<option value="" >请选择</option>')
                    $("#outUserId").attr("disabled", true);
                }
            }
        });
    }


    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-tag-edit').serialize());
        }
    }

    $("input[name='collectScanDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='scanDeptDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='collectUpdateDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='intoDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });

    $("input[name='outDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>